<template>
  <div class="page-modal">
    <el-dialog :title="title" v-model="visible" width="30%" center>
      <cc-form v-bind="modalConfig" v-model="formData"></cc-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="visible = false">取消</el-button>
          <el-button type="primary" @click="visible = false">确定</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import { CcForm } from '@/base-ui/form'
import { ElDialog, ElButton } from 'element-plus'

export default defineComponent({
  components: { CcForm, ElDialog, ElButton },
  props: {
    modalConfig: {
      type: Object,
      required: true
    },
    title: {
      type: String,
      default: '编辑'
    },
    visible: {
      type: Boolean,
      default: true
    },
    formData: {
      type: Object,
      required: true
    }
  },
  setup(props) {
    return {}
  }
})
</script>
<style scoped></style>
